var lengthOfLongestSubstring = function(s) {
    var maxlen = 0 
    for(var i=0,len=s.length; i<len; i++){
        var obj = {}
        obj[s[i]] = true
        for(var j=i+1; j<len; j++){
            if(!obj[s[j]]){
                obj[s[j]] = true
            } else {
                maxlen = Object.keys(obj).length > maxlen ?  Object.keys(obj).length : maxlen
            }
        }
    }

   return maxlen
};


lengthOfLongestSubstring("abcdabcbb")




